<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="_token" content="{{ csrf_token() }}"/>
  <title>Qkids久趣英语</title>

  @if (getenv('APP_ENV') === 'local')
  <link href="{{env('CDN_RESOURCE')}}/mobile/campaign/phonics/css/verifyPament.css?v={{config('app.version')}}" rel="stylesheet" type="text/css">
  @else
  <link href="{{env('CDN_RESOURCE')}}/mobile/campaign/phonics/css/verifyPament.min.css?v={{config('app.version')}}" rel="stylesheet" type="text/css">
  @endif
</head>
<body>
<div class="container">
  <div class="title">恭喜您！</div>
  <div class="content">
    <span id="type-1">已解锁2节久趣自然拼读课！</span><span id="type-2">成功获得4节自然拼读体验课！</span><br/>
    快来久趣英语服务号给孩子约课吧！
  </div>
  <div id="qrcode-1" class="qrcode">
    <img src="{{env('CDN_RESOURCE')}}/mobile/campaign/phonics/img/wechat_qr.png?v={{config('app.version')}}">
    <div class="text">重要：如未成功关注服务号，无法上课！</div>
  </div>
  <div id="qrcode-2" class="qrcode">
    <img src="{{env('CDN_RESOURCE')}}/mobile/campaign/phonics/img/wechat_qr.jpg?v={{config('app.version')}}">
    <div class="text">重要：如未成功关注服务号，无法上课！</div>
  </div>
</div>

<script type="text/javascript">
  if (getQueryString('type') === '2') {
    document.getElementById('type-2').style.display = 'inline-block'
    document.getElementById('qrcode-2').style.display = 'block'
  } else {
    document.getElementById('type-1').style.display = 'inline-block'
    document.getElementById('qrcode-1').style.display = 'block'
  }

  function getQueryString (name) {
    var r1 = getMatched(name, window.location.search)
    if (r1) return r1
    var key = arguments[1]
    if (key) {
      return getMatched(name, window.localStorage.getItem(key))
    }
    return null

    function getMatched (name, string) {
      if (string) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
        var len = string.indexOf('?') == 0 ? 1 : 0
        var r = string.substr(len).match(reg)
        if (r != null) return unescape(r[2])
      }
      return null
    }
  }
</script>

</body>
</html>